Skip to content

[backport camel-4.22.x] CAMEL-25694: camel-milo - fix write/call service failures being reported as success - #28367

Merged
gnodet merged 4 commits into
camel-4.22.xfrom
backport/27956-to-camel-4.22.x
Nov 2, 2026
Merged

gnodet merged 4 commits into
camel-4.22.xfrom
backport/27956-to-camel-4.22.x

Conversation

@gnodet

@gnodet gnodet commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Backport of #27956

Cherry-pick of 3307540 to camel-4.22.x.
Conflicts resolved automatically by backport bot agent.

Conflict resolution: The 4.24 upgrade guide entry was moved to the 4.22 upgrade guide (since that file doesn't exist on this branch).

@gnodet gnodet added the backport indicate that a Pull request is a backport from a fix from the main branch label Oct 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR

The production change and the tests are the same as #27956. Two of the new tests do not compile on camel-4.22.x, and the upgrade-guide note is in an older section.

Blockers

  • MiloClientProducerWriteFailureTest.java:68 calls super(new MiloClientConfiguration()). On camel-4.22.x the only MiloClientConnection constructor also takes a MonitorFilterConfiguration. The one-argument constructor came with CAMEL-25145, which is on main only. super(new MiloClientConfiguration(), new MonitorFilterConfiguration()) fixes it.
  • SubscriptionManagerExceptionPropagationTest.java:155, :173 and :193 call new SubscriptionManager(config, executor, executor, 10_000). On camel-4.22.x the constructor is (MiloClientConfiguration, ScheduledExecutorService, long). The four-argument form came with CAMEL-25812 (#28111), which is on main only. new SubscriptionManager(new MiloClientConfiguration(), executor, 10_000) fixes it.

Other findings: 2

  • The note === camel-milo - an awaited write, call or read that fails now fails the exchange is at camel-4x-upgrade-guide-4_22.adoc:2106, inside "Upgrading Camel 4.21 to 4.22". The change ships in 4.22.3, so the note belongs under "Upgrading from 4.22.2 to 4.22.3" (line 14).
  • The 4.22 guide on main does not have this note yet. It should go under "Upgrading from 4.22.2 to 4.22.3" there too. One small PR on main can add it to the 4.22 and 4.18 guides together.

The CI failure is this compile error. The build (25, false) job failed, and the JDK 17 job was cancelled after it. A re-run will not help until the tests are fixed. The rest of the code the new tests use is the same on this branch, so I expect them to pass after these two changes, but CI has not run them yet.


Reviewed with Claude Code on behalf of @davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@davsclaus

Copy link
Copy Markdown
Contributor

@gnodet friendly ping: this one has a merge conflict, and the milo tests have the same constructor compile errors as #28368 (see the review from 2026-10-23).

Claude Code on behalf of davsclaus

…scriptionManager constructor calls in tests

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on @davsclaus's review — the two constructor blockers are resolved in this push. One structural issue remains.

✅ Resolved:

  • MiloClientProducerWriteFailureTest: now calls super(new MiloClientConfiguration(), null) — compiles on camel-4.22.x (2-arg constructor; null is safe, the field is null-guarded at all usage sites).
  • SubscriptionManagerExceptionPropagationTest: now calls new SubscriptionManager(new MiloClientConfiguration(), executor, 10_000) — 3-arg form matches the branch constructor.

🔴 Remaining — upgrade guide section (blocker):
The camel-milo note was appended at line 2106, inside the "Upgrading Camel 4.21 to 4.22" section. This fix ships in 4.22.3, so the note belongs under "Upgrading from 4.22.2 to 4.22.3" (the section that starts at line 14).

Please delete the block from lines 2105–2116 (end of file) and insert it between the camel-azure-eventhubs note and == Upgrading from 4.22.1 to 4.22.2, so the result reads:

== Upgrading from 4.22.2 to 4.22.3

=== camel-azure-eventhubs - an event that completes...
...set. Routes that read this header can now see `timeout` as well as `size`.

=== camel-milo - an awaited write, call or read that fails now fails the exchange

An awaited `milo-client` write, method call or read that fails at the service or transport level, for example a
request that times out (`Bad_Timeout`) or a lost connection, now fails the exchange and lets the route's error
handler run. Before, the exchange completed without an error and with a `null` body, silently discarding the failure.
A bad status for the node itself, such as `Bad_TypeMismatch` on a write, is not a failure of the operation and is
still returned as the body.

An awaited `call` that succeeds now returns the `CallMethodResult` as the exchange body. Before, the body was
always `null` even on success. A route that reads the result of an awaited call must be updated to read the
`CallMethodResult` from the body instead of expecting `null`.

== Upgrading from 4.22.1 to 4.22.2

⚠️ Note (low, non-blocker):
MiloClientProducerWriteFailureTest uses getDeclaredField("connection") to inject the stub connection. This is fragile — a field rename silently breaks the test at runtime. Consider a package-private setter or constructor parameter for testability.

Production fix: The handleAsync → whenCompleteAsync change is correct. whenCompleteAsync runs the side-effect (handleConnectionFailure) without consuming the future's result or exception — downstream callers see the original completion state unmodified. The test coverage is thorough: SubscriptionManagerExceptionPropagationTest validates the contract directly (including a documentation test for the old buggy behaviour), MiloClientProducerWriteFailureTest validates end-to-end through the producer, and testAwaitedCallReturnsResult validates that the call result is now returned on success.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All blockers resolved in the latest push.

✅ Fixed:

  • Upgrade guide: camel-milo note now correctly placed under "Upgrading from 4.22.2 to 4.22.3" (moved from the 4.21→4.22 section at the end of the file).
  • Merge with camel-4.22.x resolved — the branch is no longer conflicting.

The production fix and tests are identical to #27956. CI should be green after the push.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • components/camel-milo
  • docs

🔬 Scalpel shadow comparison — Scalpel: 10 tested, 28 compile-only — current: 9 all tested

Maveniverse Scalpel detected 38 affected modules (current approach: 9).

⚠️ Modules only in Scalpel (29)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • docs
  • dummy-component

Skip-tests mode would test 10 modules (2 direct + 8 downstream), skip tests for 28 (generated code, meta-modules)

Modules Scalpel would test (10)
  • camel-jbang-mcp
  • camel-jbang-plugin-mcp
  • camel-jbang-plugin-route-parser
  • camel-jbang-plugin-tui
  • camel-jbang-plugin-validate
  • camel-launcher-container
  • camel-milo
  • camel-yaml-dsl-validator
  • camel-yaml-dsl-validator-maven-plugin
  • docs
Modules with tests skipped (28)
  • apache-camel
  • camel-allcomponents
  • camel-catalog
  • camel-catalog-console
  • camel-catalog-lucene
  • camel-catalog-maven
  • camel-catalog-suggest
  • camel-componentdsl
  • camel-csimple-maven-plugin
  • camel-endpointdsl
  • camel-endpointdsl-support
  • camel-itest
  • camel-jbang-core
  • camel-jbang-it
  • camel-jbang-main
  • camel-jbang-plugin-edit
  • camel-jbang-plugin-generate
  • camel-jbang-plugin-kubernetes
  • camel-jbang-plugin-test
  • camel-kamelet-main
  • camel-launcher
  • camel-report-maven-plugin
  • camel-route-parser
  • camel-yaml-dsl
  • camel-yaml-dsl-deserializers
  • camel-yaml-dsl-maven-plugin
  • coverage
  • dummy-component

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

All tested modules (38 modules)
  • Camel :: All Components Sync point
  • Camel :: Assembly
  • Camel :: Catalog :: CSimple Maven Plugin (deprecated)
  • Camel :: Catalog :: Camel Catalog
  • Camel :: Catalog :: Camel Report Maven Plugin
  • Camel :: Catalog :: Camel Route Parser
  • Camel :: Catalog :: Console
  • Camel :: Catalog :: Dummy Component
  • Camel :: Catalog :: Lucene (deprecated)
  • Camel :: Catalog :: Maven
  • Camel :: Catalog :: Suggest
  • Camel :: Component DSL
  • Camel :: Coverage
  • Camel :: Docs
  • Camel :: Endpoint DSL
  • Camel :: Endpoint DSL :: Support
  • Camel :: Integration Tests
  • Camel :: JBang :: Core
  • Camel :: JBang :: Integration tests
  • Camel :: JBang :: MCP
  • Camel :: JBang :: Main
  • Camel :: JBang :: Plugin :: Edit
  • Camel :: JBang :: Plugin :: Generate
  • Camel :: JBang :: Plugin :: Kubernetes
  • Camel :: JBang :: Plugin :: MCP
  • Camel :: JBang :: Plugin :: Route Parser
  • Camel :: JBang :: Plugin :: TUI
  • Camel :: JBang :: Plugin :: Testing
  • Camel :: JBang :: Plugin :: Validate
  • Camel :: Kamelet Main
  • Camel :: Launcher
  • Camel :: Launcher :: Container
  • Camel :: Milo
  • Camel :: YAML DSL
  • Camel :: YAML DSL :: Deserializers
  • Camel :: YAML DSL :: Maven Plugins
  • Camel :: YAML DSL :: Validator
  • Camel :: YAML DSL :: Validator Maven Plugin

⚙️ View full build and test results

@davsclaus davsclaus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TL;DR

Approve: looks good.
Blockers: None.
Other findings: 1 docs follow-up on main.

The production change and the tests now match #27956 line for line, apart from the constructor calls that had to change for this branch:

  • MiloClientProducerWriteFailureTest.java:68: super(new MiloClientConfiguration(), null) matches the only constructor on 4.22.x, MiloClientConnection(MiloClientConfiguration, MonitorFilterConfiguration). null is fine here: the field is only read in monitorValue, which the stub never reaches.
  • SubscriptionManagerExceptionPropagationTest.java:155/173/193: new SubscriptionManager(config, executor, 10_000) matches SubscriptionManager(MiloClientConfiguration, ScheduledExecutorService, long) on 4.22.x.
  • The guide note is now under "Upgrading from 4.22.2 to 4.22.3" (camel-4x-upgrade-guide-4_22.adoc:29), which is correct: the latest tag is camel-4.22.2.

Follow-up (not for this PR)

  • Main's camel-4x-upgrade-guide-4_22.adoc still has no "camel-milo - an awaited write, call or read that fails now fails the exchange" note in its 4.22.3 section, and main's 4_18 guide misses the 4.18.6 one (#28368 put it on camel-4.18.x). Main only has it in the 4_24 guide. One small PR on main can add both notes.

Earlier points

  • MiloClientConnection one-argument constructor does not exist on 4.22.x: fixed.
  • SubscriptionManager four-argument constructor does not exist on 4.22.x: fixed.
  • Note in the 4.21 to 4.22 section: moved to 4.22.2 to 4.22.3.

Claude Code on behalf of davsclaus. This review was generated by an AI agent and may contain inaccuracies; please verify all suggestions before applying.

@gnodet
gnodet merged commit c5ccdd4 into camel-4.22.x Nov 2, 2026
5 checks passed
@gnodet
gnodet deleted the backport/27956-to-camel-4.22.x branch November 2, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport indicate that a Pull request is a backport from a fix from the main branch components docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants